//
//  MGTableViewSection.h
//  Mango
//
//  Created by 胡超 on 2018/4/19.
//  Copyright © 2018年 胡超., ltd. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "MGTableViewOption.h"
#import "MGTableViewCell.h"

NS_ASSUME_NONNULL_BEGIN

@class MGTableView;

@interface MGTableViewSection : NSObject

@property (nonatomic,readonly) NSArray <MGTableViewCell *> *cells;

// heightForHeader和heightForFooter默认为-1，不生效，取tableView的sectionHeaderHeight和sectionFooterHeight
@property (nonatomic,assign) CGFloat heightForHeader;
@property (nonatomic,assign) CGFloat heightForFooter;

@property (nonatomic,nullable,copy) NSString *headerTitle;
@property (nonatomic,nullable,copy) NSString *footerTitle;

@property (nonatomic,nullable,strong) UIView *headerView;
@property (nonatomic,nullable,strong) UIView *footerView;

@property (nonatomic,weak)   MGTableView       *tableView;
@property (nonatomic,strong) MGTableViewOption *option;

#pragma mark - Add Cell
// NormalCell
- (void)addNormalCell:(nullable UIImage *)image title:(nullable NSString *)title;
- (void)addNormalCell:(nullable UIImage *)image title:(nullable NSString *)title require:(BOOL)require;
- (void)addNormalCell:(nullable UIImage *)image title:(nullable NSString *)title push:(Class)push;
- (void)addNormalCell:(nullable UIImage *)image title:(nullable NSString *)title push:(Class)push require:(BOOL)require;
- (void)addNormalCell:(nullable UIImage *)image title:(nullable NSString *)title target:(id)target selector:(SEL)selector;
- (void)addNormalCell:(nullable UIImage *)image title:(nullable NSString *)title target:(id)target selector:(SEL)selector require:(BOOL)require;
- (void)addNormalCell:(nullable UIImage *)image title:(nullable NSString *)title attributes:(NSArray *)attributes target:(id)target selector:(SEL)selector require:(BOOL)require;

- (void)addNormalCell:(nullable UIImage *)image title:(nullable NSString *)title detail:(nullable NSString *)detail;
- (void)addNormalCell:(nullable UIImage *)image title:(nullable NSString *)title detail:(nullable NSString *)detail require:(BOOL)require;
- (void)addNormalCell:(nullable UIImage *)image title:(nullable NSString *)title detail:(nullable NSString *)detail push:(Class)push;
- (void)addNormalCell:(nullable UIImage *)image title:(nullable NSString *)title detail:(nullable NSString *)detail push:(Class)push require:(BOOL)require;
- (void)addNormalCell:(nullable UIImage *)image title:(nullable NSString *)title detail:(nullable NSString *)detail target:(id)target selector:(SEL)selector;
- (void)addNormalCell:(nullable UIImage *)image title:(nullable NSString *)title detail:(nullable NSString *)detail target:(id)target selector:(SEL)selector require:(BOOL)require;

- (void)addNormalCell:(nullable UIImage *)image title:(nullable NSString *)title detail:(nullable NSString *)detail attrbutes:(nullable NSArray *)attrbutes push:(nullable Class)push target:(nullable id)target selector:(nullable SEL)selector require:(BOOL)require;

// SwitchCell
- (void)addSwitchCell:(nullable NSString *)title on:(BOOL)on target:(id)target selector:(SEL)selector;
- (void)addSwitchCell:(nullable NSString *)title detail:(nullable NSString *)detail on:(BOOL)on target:(id)target selector:(SEL)selector;
- (void)addSwitchCell:(nullable UIImage *)image title:(nullable NSString *)title detail:(nullable NSString *)detail on:(BOOL)on target:(id)target selector:(SEL)selector;
// CustomCell
- (void)addCustomCell:(MGTableViewCell *)cell;

@end

NS_ASSUME_NONNULL_END
